/*
 * Description: description of enums.js
 * Company: 联宝（合肥）电子科技有限公司
 * Author: Dongxu.Ni
 * Date: 2020/4/14 17:30
 */
import {
  TEAM_LIST,
  BU_LIST,
  GCM_FUNCTION_LIST,
  RD_FUNCTION_LIST,
  LCD_LIST,
  PLATFORM_LIST
} from '../../const/server-map'

const state = {
  teamList: TEAM_LIST,
  buList: BU_LIST,
  gcmFunctionList: GCM_FUNCTION_LIST,
  rdFunctionList: RD_FUNCTION_LIST,
  lcdList: LCD_LIST,
  platformList: PLATFORM_LIST
}

const getters = {
  getTeamList: state => state.teamList,
  getTeamListOnly: state => {
    return state.teamList.filter(item => item !== 'ALL' && item !== 'NONE')
  },
  getBuList: state => state.buList,
  getBuListOnly: state => {
    return state.buList.filter(item => item !== 'ALL' && item !== 'NONE')
  },
  getGcmFunctionList: state => state.gcmFunctionList,
  getGcmFunctionListOnly: state => {
    return state.gcmFunctionList.filter(item => item !== 'ALL' && item !== 'NONE')
  },
  getRdFunctionList: state => state.rdFunctionList,
  getLcdList: state => state.lcdList,
  getPlatformList: state => state.platformList
}

export default {
  namespaced: true,
  state,
  getters
}
